package org.vdab.projects.tasks.client.gui;

import org.vdab.projects.tasks.shared.entities.ITask;
import org.vdab.projects.tasks.shared.entities.impl.Task;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class TaskWidget extends Composite {

	private static TaskWidgetUiBinder uiBinder = GWT
			.create(TaskWidgetUiBinder.class);

	interface TaskWidgetUiBinder extends UiBinder<Widget, TaskWidget> {
	}


	//There is no ClientTask yet (implement it when required)
	ITask myTask;
	
	@UiField Label taskNameLabel;

	public TaskWidget(ITask task) {
		initWidget(uiBinder.createAndBindUi(this));
		this.myTask = task;
		update();		
	}
	
	private void update(){
		this.taskNameLabel.setText(this.myTask.getDisplayText());
	}
}
